﻿<%@ Page Title="" Language="C#" MasterPageFile="~/master/Site.Master" AutoEventWireup="true"
	CodeBehind="LetterTemplates.aspx.cs" Inherits="Hematology.UserSite.admin.LetterTemplates" %>

<%@ Import Namespace="Hematology.Tools" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cphHead" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphRecent" runat="server">
	<hmt:PageTitle runat="server" ID="ptTitle" Text='<%$ Resources:UserSite, resMailTemplatesManagement %>'
		ButtonText='<%$ Resources:UserSite, resWhitespace %>' ButtonCssClass="plus" ShowButton="True"
		TitleButtonType="Hyperlink" NavigateUrl="/admin/LetterTemplates.aspx?view=Add" />
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cphHeadNews" runat="server">
	<div class="userFullPageContainer">
		<asp:MultiView runat="server" ID="mvLetterTemplates">
			<asp:View runat="server" ID="vLetterTemplateList">
				<asp:Repeater runat="server" ID="rptEmailTemplates" OnItemCommand="rptEmailTemplates_ItemCommand">
					<HeaderTemplate>
						<div class="adminTableBlock">
							<div class="adminTableRow adminTableRowHeader">
								<div class="adminTableRow300">
									<asp:Label ID="lTemplateNameHdr" runat="server" Text='<%$ Resources:UserSite, resTemplateName %>' />
								</div>
								<div class="adminTableRowDate">
									<asp:Label ID="lTemplateTypeHdr" runat="server" Text='<%$ Resources:UserSite, resTemplateType %>' />
								</div>
								<div class="adminTableRowDate">
									<asp:Label ID="lTemplateDateCreatedHdr" runat="server" Text='<%$ Resources:UserSite, resDateCreated %>' />
								</div>
								<div class="adminTableRowDate">
									<asp:Label ID="lTemplateDateModifiedHdr" runat="server" Text='<%$ Resources:UserSite, resDateModified %>' />
								</div>
							</div>
					</HeaderTemplate>
					<ItemTemplate>
						<div class="adminTableRow">
							<div class="adminTableRow300">
								<asp:Label ID="lTemplateName" runat="server" Text='<%# Eval("Subject") %>' />
							</div>
							<div class="adminTableRowDate">
								<asp:Label ID="lTemplateType" runat="server" Text='<%# EnumHelper.GetTemplateTypeName(Eval("TemplateType")) %>' />
							</div>
							<div class="adminTableRowDate">
								<asp:Label ID="lTemplateDateCreated" runat="server" Text='<%# PageHelper.SetDateCellContent(Eval("CreateDate")) %>' />
							</div>
							<div class="adminTableRowDate">
								<asp:Label ID="lTemplateDateModified" runat="server" Text='<%# PageHelper.SetDateCellContent(Eval("LastModifiedDate")) %>' />
							</div>
							<div class="adminTableRowIconBlock">
								<div class="adminTableRowIcon">
									<asp:HyperLink ID="hlEditTemplate" runat="server" NavigateUrl='<%# string.Format("/admin/LetterTemplates.aspx?view=Edit&id={0}", Eval("TemplateId")) %>'
										ToolTip="Правка" CssClass="adminTableRowEdit" />
								</div>
							</div>
						</div>
					</ItemTemplate>
					<FooterTemplate>
						</div> </div>
						<div style="clear: both;">
					</FooterTemplate>
				</asp:Repeater>
			</asp:View>
			<asp:View runat="server" ID="vLetterTemplateEdit">
				<div class="editorBlock">
					<div class="editorBlockEditControl">
						<div class="editorBlockTitle">
							<asp:Label runat="server" ID="lblUserMailSubject" Text="Заголовок письма" />
						</div>
						<div class="editorBlockControl">
							<asp:TextBox runat="server" ID="txtUserMailSubject" MaxLength="150" />
						</div>
					</div>
					<asp:Panel runat="server" ID="pnlTemplateType" CssClass="editorBlockEditControl"
						Visible="false">
						<div class="editorBlockTitle">
							<asp:Label runat="server" ID="lblTemplateType" Text='<%$ Resources:UserSite, resTemplateType %>' />
						</div>
						<div class="editorBlockControl">
							<asp:DropDownList runat="server" ID="ddlTemplateType" />
						</div>
					</asp:Panel>
					<div class="editorBlockWisiwig">
						<CKEditor:CKEditorControl runat="server" ID="ckedUserMailContent" BasePath="~/ckeditor" />
					</div>
					<div class="editorBlockEditControl">
						<asp:Repeater runat="server" ID="rptEmailAttach" OnItemCommand="rptEmailAttach_ItemCommand">
							<HeaderTemplate>
								<div class="adminTableContainer">
									<div class="adminTableBlock">
										<div class="adminTableRow adminTableRowHeader">
											<div class="adminTableRow32">
												<asp:Label ID="lFileIconHdr" runat="server" Text='<%$ Resources:UserSite, resWhitespace %>' />
											</div>
											<div class="adminTableRow300">
												<asp:Label ID="lFileNameHdr" runat="server" Text='<%$ Resources:UserSite, resFileName %>' />
											</div>
											<div class="adminTableRow150 centered">
												<asp:Label ID="lFileFormatHdr" runat="server" Text='<%$ Resources:UserSite, resFileFormat %>' />
											</div>
											<div class="adminTableRow150 centered">
												<asp:Label ID="lFileSizeHdr" runat="server" Text='<%$ Resources:UserSite, resFileSize %>' />
											</div>
										</div>
							</HeaderTemplate>
							<ItemTemplate>
								<div class="adminTableRow">
									<div class="adminTableRow32">
										<asp:LinkButton runat="server" ID="btnOpenDocumentIcon" CssClass='<%# PageHelper.GetAttachIconClass(Eval("DocumentName")) %>'
											Text='<%$ Resources:UserSite, resWhitespace %>' />
									</div>
									<div class="adminTableRow300">
										<asp:LinkButton runat="server" ID="btnOpenDocument" Text='<%# Eval("DocumentName") %>'
											CommandName="OpenAttach" CommandArgument='<%# Eval("AttachId") %>' />
									</div>
									<div class="adminTableRow150 centered">
										<asp:Label ID="lDocumentType" runat="server" Text='<%# Eval("DocumentType") %>' />
									</div>
									<div class="adminTableRow150 centered">
										<asp:Label ID="lFileSize" runat="server" Text='<%# PageHelper.GetRoundedFileSize(Eval("DocumentSize")) %>' />
									</div>
									<div class="adminTableRowIcon">
										<div class="adminTableRowIcon">
											<asp:LinkButton ID="btnDeleteAttach" runat="server" ToolTip="Удалить" CommandName="DeleteAttach"
												CommandArgument='<%# Eval("AttachId") %>' OnClientClick="return confirm('Подтвердите удаление')"
												CssClass="adminTableRowDelete" />
										</div>
									</div>
								</div>
							</ItemTemplate>
							<FooterTemplate>
								</div> </div>
								<div style="clear: both;">
								</div>
							</FooterTemplate>
						</asp:Repeater>
					</div>
					<div class="editorDatePickerBlockControl">
						<div class="editorDatePickerTitle">
							<asp:Label ID="lblAttachFile" runat="server" Text='<%$ Resources:UserSite, resAttachFile %>' />
						</div>
						<div class="editorDatePicker">
							<asp:FileUpload runat="server" ID="fuAttachFile" />
						</div>
						<div class="editorDatePicker">
							<asp:Button runat="server" ID="btnSaveAttach" Text='<%$ Resources:UserSite, resSaveFile %>'
								OnClick="btnSaveAttach_Click" Visible="False" />
						</div>
					</div>
					<div class="editorBlockButton">
						<asp:Button runat="server" ID="btnSaveTempalte" Text='<%$ Resources:UserSite, resSaveTemplate %>'
							OnClick="btnSaveTempalte_Click" />
						<asp:Button runat="server" ID="btnList" Text='<%$ Resources:UserSite, resToList %>'
							OnClick="btnList_Click" />
					</div>
				</div>
			</asp:View>
		</asp:MultiView>
	</div>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="cphBody" runat="server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="cphPanel" runat="server">
</asp:Content>
